package com.wkq.controller;

import com.wkq.dao.ILogDao;
import com.wkq.domain.SysLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/sysLog")
public class LogController {

    @Autowired
    private ILogDao iLogDao;

    @RequestMapping(value = "/findAll")
    @ResponseBody
    public ModelAndView findAll () {
        ModelAndView mv = new ModelAndView();
        List<SysLog> logList = iLogDao.findAll();
        mv.addObject("sysLogs", logList);
        mv.setViewName("syslog-list");
        return mv;
    }
}
